<template>
  <div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="发票记录" name="receipt_record" v-if="is_admin==1"></el-tab-pane>

      <el-tab-pane label="发票抬头" name="receipt_rise" v-if="is_admin==0"></el-tab-pane>
    </el-tabs>
    <router-view></router-view>
  </div>
</template>

<script>
    export default {
      name: "receipt_system",
      data() {
        return {
          activeName: '',
          is_admin: window.localStorage.getItem('is_admin')
        };
      },
      mounted(){
        this.activeName = window.localStorage.getItem('is_admin')==1?'receipt_record':'receipt_rise';
        console.log(this.activeName)
        this.handleClick();
      },
      methods: {
        handleClick(tab, event) {
          this.$router.push(this.activeName)
        }
      },
    }
</script>

<style scoped>

</style>
